<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        /* div下面的所有子级p标签都会被选中 */
        /* div p{
            color: green
        } */

        /* css3层级选择器 */
        /* > 大于号 直接子级 */
        .box>div {
            /* color: red */
            width: 100px;
            height: 100px;
            border: 1px solid red
        }

        /* + 相邻子级 */
        div p+h1{
            color: red
        }

        /* ~ 表示当前元素后面的所有标签  */
        div p~h1{
            color: green
        }
    </style>
</head>

<body>
    <!-- <div class="box">
        <div>
            <div>01</div>
            <div>02</div>
            <div>03</div>
        </div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
    </div> -->
    <div>
            <h1>3</h1>
        <p>p</p>
        <h1>h1</h1>
        <h1>1</h1>
        <h1>2</h1>
        <h1>3</h1>
        <h2>1111</h2>
    </div>

    <div id="head">
        <div class="head-con">
            <!-- 左 -->
            <div>
                <div></div>
            </div>
            <div></div>
            <div></div>
        </div>
    </div>
</body>

</html>